A hotkey opens the pastes you keep, and the number key is a position - #32
Merged
Conversation
ADDED: `clipboard_set_text` as a platform seam, never `SDL_SetClipboardText`. ADDED: an X11 selection owner on a thread of its own — its own `Display`, poked through a self-pipe, serving TARGETS, TIMESTAMP, UTF8_STRING, the two text/plain forms and STRING for the life of the process. - A selection is a live window answering `SelectionRequest`, not a place to put bytes: the owner has to still be there when the paste happens. - STRING is served the same UTF-8 bytes deliberately. It is nominally Latin-1, but everything that can read UTF-8 asks for UTF8_STRING first, and refusing STRING leaves the rest with nothing. ADDED: the Windows write, `OpenClipboard`/`CF_UNICODETEXT`, retried while another application holds the lock. ADDED: `kMaxClipboardWrite`, 64KB — one `XChangeProperty`, no INCR on this side. CHANGED: the write blocks until the server reports us as the owner, bounded at 250ms. - The caller hands the focus back to the game immediately afterwards and Wine re-reads the selection around that focus change, so returning early is a first paste of the previous clipboard. Measured at 0.1-0.7ms.
ADDED: QuickPaste — Alt+V opens a list of saved snippets at the cursor; picking one puts its text on the clipboard, closes the popup and gives the game back the foreground. Nothing presses Ctrl+V. ADDED: the entries themselves, heading and multi-line body, in `config.json` under `pastes` and in PRIVACY.md, since they are text the user typed. ADDED: a QuickPaste tab in Settings — a read-only list to arrange, with adding and editing in a modal dialog on a draft, and drag-to-reorder on a grip handle. ADDED: picking by number key, read as `SDL_Scancode`. - A keycode test would leave the feature unusable by number outside a US layout: the same physical keys print `ěščřžýáíé` on a Czech one. ADDED: nine active slots, which is how many number keys there are. Storage is unbounded and `enabled` is what competes for a number; the ceiling holds on config load too, and the tenth checkbox is disabled rather than refused. ADDED: four Font Awesome glyphs — grip-lines, pen, trash-can, square-plus. CHANGED: `kOnlyGlyphs` is derived from `kGlyphCodepoints` rather than hand-written. - The old range covered U+F00C..U+F0E2 because that was where the first two glyphs happened to sit, so all four new ones baked as nothing. CHANGED: nothing of ours stays on screen when the game is present and a third application is in front — panels included, not only the idle marker. Panels stay up when the game is *gone*, or they would be unreachable. CHANGED: the keyboard focus is re-claimed when the game comes back to the front and on a click into a panel, not only when the panel opens. - Our window is override-redirect, so the window manager will never focus it: a panel that lost the focus to an alt-tab was left on screen taking no input. CHANGED: `Config::load` reads every field inside one `try`. - `config.json` is hand-editable and nlohmann throws as readily on a field of the wrong type as on a truncated file, so an object where a string belongs was an uncaught exception before the first window.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release notes
ADDED: QuickPaste. Alt+V opens your saved snippets at the cursor — a map regex, a vendor
search, the whisper you send twenty times an evening. Click one or press its number and it is on
your clipboard. It does not press Ctrl+V for you: you paste it yourself, in the field you meant, at
your own time.
ADDED: the number keys go by the key's position, so the top row picks a paste whatever your
layout prints on it.
ADDED: nine at a time, because that is how many number keys there are. Keep as many as you like —
the ones beyond nine are simply switched off until you switch something else off. Nothing to read,
nothing refused.
ADDED: a QuickPaste tab in Settings to write them, drag them into the order you want them
offered in, and switch them in and out. Adding and editing happen in a dialog; nothing is kept
until you Save, so a delete you did not mean is undone by closing Settings.
ADDED: the popup opens at your cursor, growing down, up, or from somewhere between the two,
whichever fits.
CHANGED: no panel of ours stays on screen when you alt-tab to another application, and one that
was open takes the keyboard again when you come back to the game.
CHANGED: a
config.jsonthat has been edited by hand into something unreadable no longer stopsthe tool from starting. It keeps what it could read and defaults the rest.
Review notes
ADDED:
clipboard_set_textas a platform seam, neverSDL_SetClipboardText.ADDED: an X11 selection owner on a thread of its own — its own
Display, poked through aself-pipe, serving TARGETS, TIMESTAMP, UTF8_STRING, the two text/plain forms and STRING for the
life of the process.
SelectionRequest, not a place to put bytes: the ownerhas to still be there when the paste happens.
can read UTF-8 asks for UTF8_STRING first, and refusing STRING leaves the rest with nothing.
ADDED: the Windows write,
OpenClipboard/CF_UNICODETEXT, retried while another application holdsthe lock.
ADDED:
kMaxClipboardWrite, 64KB — oneXChangeProperty, no INCR on this side.ADDED: QuickPaste — the model in
ppc_core(src/quickpaste.{hpp,cpp}), the popup(
quickpaste_screen.cpp), the Settings tab (quickpaste_tab), anddocs/quickpaste.md.ADDED: the entries in
config.jsonunderpastes, and in PRIVACY.md, since they are text the usertyped.
ADDED: picking by number key, read as
SDL_Scancode.keys print
ěščřžýáíéon a Czech one.ADDED: nine active slots. Storage is unbounded and
enabledis what competes for a number;limit_enabledholds the ceiling on config load as well as in the UI.ADDED: drag-to-reorder on a grip handle, measured in pixels of travel rather than in rows crossed,
and tracked by us rather than by ImGui's held-item id.
two lines and the second wraps, so a move drops the pointer back over the row it came from and
the list flickers between the two.
slid into the vacated place.
ADDED: four Font Awesome glyphs — grip-lines, pen, trash-can, square-plus.
ADDED:
quickpaste_test— slot ordering, the ceiling,move_paste, the one-line preview on aUTF-8 boundary, and a config round trip.
CHANGED: the write blocks until the server reports us as the owner, bounded at 250ms.
selection around that focus change, so returning early is a first paste of the previous
clipboard. Measured at 0.1-0.7ms.
CHANGED:
kOnlyGlyphsis derived fromkGlyphCodepointsrather than hand-written.so all four new ones baked as nothing.
CHANGED: nothing of ours stays on screen when the game is present and a third application is in
front — panels included, not only the idle marker. Panels stay up when the game is gone, or they
would be unreachable.
CHANGED: the keyboard focus is re-claimed when the game comes back to the front and on a click into
a panel, not only when the panel opens.
focus to an alt-tab was left on screen taking no input.
CHANGED:
Config::loadreads every field inside onetry.config.jsonis hand-editable and nlohmann throws as readily on a field of the wrong type as ona truncated file, so an object where a string belongs was an uncaught exception before the first
window.
CHANGED: VERSION to 0.5, in its own commit.
🤖 Generated with Claude Code